import cv2
import os
import numpy as np

# g(x,y) = f(x,y)h(x,y)

srcImgPath = os.getcwd().strip('code\ch3') + '\pic\DIP3E_Original_Images_CH03\Fig0304(a)(breast_digital_Xray).tif'
srcImg = cv2.imread(srcImgPath, cv2.IMREAD_GRAYSCALE)
maskImg = np.full(srcImg.shape, 255, dtype=np.uint8)
resImg = np.zeros(srcImg.shape, dtype=np.uint8)
cv2.subtract(maskImg, srcImg, resImg)
cv2.imshow("src", srcImg)
cv2.imshow("res", resImg)
cv2.waitKey(0)